package cn.csg.iotplatform.module.system.dal.mysql.testingmanufacturer;


import cn.csg.iotplatform.framework.common.pojo.PageResult;
import cn.csg.iotplatform.framework.mybatis.core.mapper.BaseMapperX;
import cn.csg.iotplatform.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.csg.iotplatform.module.system.controller.admin.testingmanufacturer.vo.DvTestingManufacturerPageReqVO;
import cn.csg.iotplatform.module.system.dal.dataobject.testingmanufacturer.DvTestingManufacturerDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 检测机构信息 Mapper
 *
 * @author 系统管理员1111
 */
@Mapper
public interface DvTestingManufacturerMapper extends BaseMapperX<DvTestingManufacturerDO> {

    default PageResult<DvTestingManufacturerDO> selectPage(DvTestingManufacturerPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DvTestingManufacturerDO>()
                .likeIfPresent(DvTestingManufacturerDO::getManufacturerType, reqVO.getManufacturerType())
                .likeIfPresent(DvTestingManufacturerDO::getManufacturerNo, reqVO.getManufacturerNo())
                .likeIfPresent(DvTestingManufacturerDO::getManufacturerName, reqVO.getManufacturerName())
                .eqIfPresent(DvTestingManufacturerDO::getManufacturerId, reqVO.getManufacturerId())
                .likeIfPresent(DvTestingManufacturerDO::getManufacturerShortName, reqVO.getManufacturerShortName())
                .eqIfPresent(DvTestingManufacturerDO::getUnifiedSocialCreditCode, reqVO.getUnifiedSocialCreditCode())
                .eqIfPresent(DvTestingManufacturerDO::getManufacturerUrl, reqVO.getManufacturerUrl())
                .eqIfPresent(DvTestingManufacturerDO::getServiceEmail, reqVO.getServiceEmail())
                .eqIfPresent(DvTestingManufacturerDO::getServiceTel, reqVO.getServiceTel())
                .eqIfPresent(DvTestingManufacturerDO::getBusinessCode, reqVO.getBusinessCode())
                .eqIfPresent(DvTestingManufacturerDO::getBusinessUrl, reqVO.getBusinessUrl())
                .eqIfPresent(DvTestingManufacturerDO::getLogo, reqVO.getLogo())
                .eqIfPresent(DvTestingManufacturerDO::getAuthStatus, reqVO.getAuthStatus())
                .eqIfPresent(DvTestingManufacturerDO::getProvince, reqVO.getProvince())
                .eqIfPresent(DvTestingManufacturerDO::getCity, reqVO.getCity())
                .eqIfPresent(DvTestingManufacturerDO::getArea, reqVO.getArea())
                .eqIfPresent(DvTestingManufacturerDO::getManufacturerAddress, reqVO.getManufacturerAddress())
                .eqIfPresent(DvTestingManufacturerDO::getManufacturerAddressDetail, reqVO.getManufacturerAddressDetail())
                .eqIfPresent(DvTestingManufacturerDO::getManufacturerUser, reqVO.getManufacturerUser())
                .eqIfPresent(DvTestingManufacturerDO::getManufacturerTel, reqVO.getManufacturerTel())
                .eqIfPresent(DvTestingManufacturerDO::getContactAddress, reqVO.getContactAddress())
                .eqIfPresent(DvTestingManufacturerDO::getContactEmail, reqVO.getContactEmail())
                .eqIfPresent(DvTestingManufacturerDO::getIntroduce, reqVO.getIntroduce())
                .eqIfPresent(DvTestingManufacturerDO::getNote, reqVO.getNote())
                .eqIfPresent(DvTestingManufacturerDO::getDataSource, reqVO.getDataSource())
                .eqIfPresent(DvTestingManufacturerDO::getEnablingStatus, reqVO.getEnablingStatus())
                .betweenIfPresent(DvTestingManufacturerDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(DvTestingManufacturerDO::getCertificates, reqVO.getCertificates())
                .orderByDesc(DvTestingManufacturerDO::getId));
    }

}